package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2023/10/23 14:13
 */
@Getter
@Setter
@Table(name = "t_message")
@TableName(value = "t_message")
public class MessageEntity{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 消息类型(1.计划消息  2.)
     */
    @Column(name = "message_type",type = MySqlTypeConstant.TINYINT)
    @TableField("message_type")
    private Integer messageType;

    /**
     * 消息内容
     */
    @Column(name = "content",type = MySqlTypeConstant.VARCHAR,length = 150)
    @TableField("content")
    private String content;

    /**
     * 创建时间
     */
    @Column(name = "create_time",type = MySqlTypeConstant.DATETIME)
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 消息状态
     */
    @Column(name = "status",type = MySqlTypeConstant.TINYINT)
    @TableField("status")
    private Integer status;

    /**
     * 工单号
     */
    @Column(name = "task_id",type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField("task_id")
    private String taskId;

    /**
     * 任务id
     */
    @Column(name = "machine_tool_task_id",type = MySqlTypeConstant.INT)
    @TableField("machine_tool_task_id")
    private Integer machineToolTaskId;

    /**
     * 关联角色
     */
    @Column(name = "connect_roles",type = MySqlTypeConstant.VARCHAR)
    @TableField("connect_roles")
    private String connectRoles;

    /**
     * 关联账号
     */
    @Column(name = "connect_operator",type = MySqlTypeConstant.VARCHAR)
    @TableField("connect_operator")
    private String connectOperator;

    /**
     * 发送时间
     */
    @Column(name = "send_time",type = MySqlTypeConstant.DATETIME)
    @TableField("send_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    /**
     * 读取时间
     */
    @Column(name = "receive_time",type = MySqlTypeConstant.DATETIME)
    @TableField("receive_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTime;

    /**
     * 发送人
     */
    @Column(name = "sender_id",type = MySqlTypeConstant.INT , length = 5)
    @TableField("sender_id")
    private Integer senderId;

    /**
     * 发送人姓名
     */
    @Column(name = "sender_name",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("sender_name")
    private String senderName;

    /**
     * 接收人
     */
    @Column(name = "receiver_id",type = MySqlTypeConstant.INT , length = 5)
    @TableField("receiver_id")
    private Integer receiverId;

    /**
     * 接收人姓名
     */
    @Column(name = "receiver_name",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("receiver_name")
    private String receiverName;

    /**
     * 读取人
     */
    @Column(name = "read_id",type = MySqlTypeConstant.INT , length = 5)
    @TableField("read_id")
    private Integer readId;

    /**
     * 读取人姓名
     */
    @Column(name = "read_name",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("read_name")
    private String readName;

}
